package com.example.computer_exam_training_sys.controller;

import com.example.computer_exam_training_sys.service.AdminUserVOService;
import com.example.computer_exam_training_sys.vo.AdminUserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/admin_user_vo")
@CrossOrigin
public class AdminUserVOController {
    @Autowired
    private AdminUserVOService adminUserVOService;

    // 查询所有管理员及其用户信息
    @GetMapping("/list")
    public List<AdminUserVO> getAllAdminUserVO() {
        return adminUserVOService.getAllAdminUserVO();
    }

    // 根据管理员ID查询
    @GetMapping("/detail/{adminId}")
    public AdminUserVO getAdminUserVOByAdminId(@PathVariable Integer adminId) {
        return adminUserVOService.getAdminUserVOByAdminId(adminId);
    }
}
